#region Using

using System;
using System.Xml;
using System.IO;
using System.Collections.Generic;
using System.Collections.Specialized;
using BlogEngine.Core;
using System.Linq;
using AzureProvider.SoupMethods;
using AzureProvider.ssdsClient;

#endregion

namespace BlogEngine.Core.Providers
{
  /// <summary>
  /// A storage provider for BlogEngine that uses XML files.
  /// <remarks>
  /// To build another provider, you can just copy and modify
  /// this one. Then add it to the web.config's BlogEngine section.
  /// </remarks>
  /// </summary>
    public partial class AzureBlogProvider : BlogProvider
  {
        PingServicesMethods PingServicesMethods = new PingServicesMethods();

    /// <summary>
    /// Loads the ping services.
    /// </summary>
    /// <returns></returns>
    public override StringCollection LoadPingServices()
    {
        StringCollection sc = new StringCollection();
        sc.AddRange(PingServicesMethods.GetPingServices(null, out errMessage).ToArray());
        return sc;
    }

    /// <summary>
    /// Saves the ping services.
    /// </summary>
    /// <param name="services">The services.</param>
    public override void SavePingServices(StringCollection services)
    {
        foreach (Entity et in PingServicesMethods.GetEntities(null, out errMessage))
        {
            PingServicesMethods.Delete(et.Id );
        }

        foreach (string  s in services)
        {
            PingServicesMethods.Insert(s, out errMessage);
        }
    }

  }
}
